package ua.org.cityid.server.guice;

import org.apache.commons.logging.Log;

import com.google.appengine.api.memcache.MemcacheService;
import com.google.inject.Singleton;

import ua.org.cityid.server.LogProvider;
import ua.org.cityid.server.DA.CityDA;
import ua.org.cityid.server.handlers.GetCitiesCountHandler;
import ua.org.cityid.server.handlers.GetCitiesHandler;
import net.customware.gwt.dispatch.server.guice.ActionHandlerModule;

public class GuiceServerModule extends ActionHandlerModule {
	public GuiceServerModule() {
	}

	@Override
	protected void configureHandlers() {
		bind(Log.class).toProvider(LogProvider.class).in(Singleton.class);
		bind(PersistenceManagerProvider.class).in(Singleton.class);
		bind(MemcacheService.class).toProvider(MemcacheServiceProvider.class).in(Singleton.class);
		bind(CityDA.class).in(Singleton.class);
		
		bindHandler(GetCitiesHandler.class);
		bindHandler(GetCitiesCountHandler.class);
	}
}

